import uuid

from sqlalchemy import (
    Column,
    String,
    Integer,
    DateTime,
    PrimaryKeyConstraint,
    Boolean,
    text, Index
)

from internal.entitry.tickets_entitry import TicketsCardType, TicketsStstaus
from internal.extension.extension_db import db
class MemberItem(db.Model):
    __tablename__ = 'member_item'
    __table_args__ = (
        PrimaryKeyConstraint('id', name='member_item_id_pkey'),
    )
    id = Column(String(36), nullable=False, default=lambda: str(uuid.uuid4()))
    touristName = Column(String(50), nullable=False) #成员姓名
    card_type = Column(String(36), nullable=False, default=TicketsCardType.ID_CARD.value) #证件类型
    bash_id = Column(String(36), nullable=False)  # 批次id
    grounp_id = Column(String(36), nullable=False,default="") #分组编号
    card_number = Column(String(50), nullable=False)  # 证件号
    touristMobile = Column(String(50), nullable=True) #手机号
    origin = Column(String(100), nullable=False)  #省/市
    updated_at = Column(
        DateTime,
        nullable=False,
        server_default=text("CURRENT_TIMESTAMP(0)"),
        server_onupdate=text("CURRENT_TIMESTAMP(0)"),
    )
    created_at = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP(0)"))

